package com.spring.boot.standard.admin.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import com.spring.boot.standard.admin.entity.Templates;

import java.util.List;

/**
 * @author qinhao
 * @since Thu Sep 09 14:31:17 CST 2021
 */
@RepositoryRestResource(exported=false)
public interface TemplatesRepository extends JpaRepository<Templates, String>,JpaSpecificationExecutor<Templates> {
		//do somethings

    @Query("select new com.spring.boot.standard.admin.entity.Templates(p.templateid,p.relativepath,p.newfilename) from Templates p where p.groupname=:groupname order by p.relativepath asc,p.newfilename asc")
    List<Templates> findListByGroupname(@Param(value="groupname") String groupname);

}